class CreateStudentGroups < ActiveRecord::Migration
  def change
    create_table :student_groups do |t|
      t.primary_key :id
      t.string :name
      t.string :description
      t.integer :parent_id, :default => 0
    end
    # creating admin group
    admin_group = StudentGroup.new(:name => 'admin', :description => 'site admin group', :parent_id => 0)
    admin_group.save
    # creating student group
    member_group = StudentGroup.new(:name => 'student', :description => 'student group', :parent_id => 0)
    member_group.save
  end
end
